package gralej.testers;

import gralej.controller.INewStreamListener;
import gralej.fileIO.FileLoader;

import java.io.File;
import java.io.IOException;

/**
 * A small application testing the file opening
 * 
 * @author Niels
 * @version $Id: FileOpenTestApp.java 187 2007-12-12 14:40:20Z armin.buch@gmx.de $
 */
public class FileOpenTestApp {

    public void runTest() throws IOException {
        INewStreamListener handler = new DummyStreamHandler();
        String path = "./testdata/test1.GRALE";
        System.err.println("-- Opening File " + path);
        FileLoader fl = new FileLoader(new File(path), true);

        fl.registerNewStreamListener(handler);
        System.err.println("-- Starting to open");
        fl.loadFile();
        System.err.println("-- Opening should run in its thread now");
    }

    /**
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {

        new FileOpenTestApp().runTest();

    }

}
